<?php
//Leaps Cache @ 2015-03-04 17:06:39
defined('LEAPS_VERSION') or exit('No permission resources.');
error_reporting ( E_ERROR );
$Head = S('common/common');
$CSS_PATH = SKIN_PATH.'default/css/';
$IMG_PATH = SKIN_PATH.'default/images/';
$JS_PATH = SKIN_PATH.'default/js/';
?>
<?php include template("content","header"); ?>
<script type="text/javascript" src="<?php echo defined('JS_PATH') ? JS_PATH : '';?>formvalidator.js" charset="UTF-8"></script> 
<script type="text/javascript" src="<?php echo defined('JS_PATH') ? JS_PATH : '';?>formvalidatorregex.js" charset="UTF-8"></script>
<link href="<?php echo  isset($CSS_PATH) ? $CSS_PATH : '';?>link.css" rel="stylesheet" type="text/css" />
<link href="<?php echo defined('CSS_PATH') ? CSS_PATH : '';?>table_form.css" rel="stylesheet" type="text/css" /> 
<!--main-->
<div class="main">
<!--left_bar-->
<div class="col-left">
<div class="crumbs"><a href="<?php echo defined('SITE_URL') ? SITE_URL : '';?>">网站首页</a><span> &gt; </span><a href="<?php echo  U('link') ;?>">友情链接</a><span> &gt; </span><?php echo $type_arr['name'];?></div>
<div>

<form action="<?php echo  U('link/index/register') ;?>" method="post" name="myform" id="myform">
<table cellspacing="1" cellpadding="0" class="table_form">
<caption>申请友情链接</caption>
<tbody><tr> 
<th width='60'>链接类型</th>
<td width="300"><input type="radio" onclick="$('#logolink').hide()" checked="checked" value="0" name="linktype" class="radio_style"> 文字链接
<input type="radio" onclick="$('#logolink').show()" value="1" name="linktype" class="radio_style"> Logo链接
</td>
</tr>
<tr> 
<th>所属分类</th>
<td>
<select  style="width: 36%;" id="typeid" name="typeid">
<option value="0">默认分类</option>
<?php $n=1;if(is_array($types)) foreach($types AS $type_arr) { ?>
<option value="<?php echo $type_arr['typeid'];?>"><?php echo $type_arr['name'];?></option>
<?php if(isset($n))$n++;} if(isset($n))unset($n); ?>
</select>
</td>
</tr>
<tr> 
<th>网站名称</th>
<td><input type="text" value="" id="name" name="name" class="input-text"></td>
</tr>
<tr> 
<th>网站地址</th>
<td><input type="text" size="40" value="" name="url" id="url" class="input-text"></td>
</tr>
<tr style="display: none;" id="logolink"> 
<th>Logo地址</th>
<td><input type="text" size="40" value="" name="logo" id="logo" class="input-text"></td>
</tr>
<?php if($setting['enablecheckcode']=='1') { ?>
<tr>
       <th>验证码：</th>
       <td><input name="code" type="text" id="code" size="10"  class="input-text"/> <?php echo  Form::checkcode('code_img','4',110,30) ;?></td>
</tr>
<?php } ?>
<tr> 
<th></th>
<td><input type="submit" value=" 申 请 " name="dosubmit" class="btn btn-primary btn-sm"> <input type="reset" value=" 取 消 " name="reset" class="btn btn-primary btn-sm"> </td>
</tr> 
</tbody></table>
</form>
        </div>

    </div>
    <!--right_bar-->
    <div class="col-auto">
    	<!--广告228x90-->
        <div class="box">
            <h5 class="title-2">友情链接分类</h5>
            <div class="tag_a">
            <a href="<?php echo  U('link/index/list_type',array('type_id'=>0)) ;?>" title="默认分类">默认分类</a>
	            <?php if(defined('IN_ADMIN')  && !defined('HTML')) {echo "<div class=\"admin_piao\" yun_action=\"link\" data=\"op=link&tag_md5=e80c244d7a0631ad9e7166425b49df7d&do=type_lists&listorder=desc\"><a href=\"javascript:void(0);\" class=\"admin_piao_edit\">编辑</a>";}$link_tag = Loader::lib("link:link_tag");if (method_exists($link_tag, 'type_lists')) {$data = $link_tag->type_lists(array('listorder'=>'desc','limit'=>'20',));}?>
	            <?php $n=1;if(is_array($data)) foreach($data AS $type_v) { ?>
	            <a href="<?php echo  U('link/index/list_type',array('type_id'=>$type_v[typeid])) ;?>" title="<?php echo $type_v['name'];?>"><?php echo $type_v['name'];?></a>
	            <?php if(isset($n))$n++;} if(isset($n))unset($n); ?>
	            <?php if(defined('IN_ADMIN') && !defined('HTML')) {echo '</div>';}?>
           </div>
        </div>
         
        <div class="bk10"></div>
         <div class="box">
            <h5 class="title-2">本站LOGO：</h5>
            <div class="tag_a pad-lr-10">
	        <?php if(defined('IN_ADMIN')  && !defined('HTML')) {echo "<div class=\"admin_piao\" yun_action=\"block\" data=\"op=block&tag_md5=523b8993a6f399c2b6a1348fa195f0ab&pos=3\"><a href=\"javascript:void(0);\" class=\"admin_piao_edit\">添加碎片</a>";}$block_tag = Loader::lib('block:block_tag');echo $block_tag->yun_tag(array('pos'=>'3',));?>
			<?php if(defined('IN_ADMIN') && !defined('HTML')) {echo '</div>';}?>
           </div>
        </div>
        <div class="bk10"></div>
        <div class="box">
            <h5 class="title-2">合作联系方式</h5>
            <div class="tag_a pad-lr-10">
	        <?php if(defined('IN_ADMIN')  && !defined('HTML')) {echo "<div class=\"admin_piao\" yun_action=\"block\" data=\"op=block&tag_md5=3acc206f3dfba56973f381bc142d098f&pos=2\"><a href=\"javascript:void(0);\" class=\"admin_piao_edit\">添加碎片</a>";}$block_tag = Loader::lib('block:block_tag');echo $block_tag->yun_tag(array('pos'=>'2',));?>
			<?php if(defined('IN_ADMIN') && !defined('HTML')) {echo '</div>';}?>
           </div>
        </div>
        <div class="bk10"></div>
         <div class="box">
            <h5 class="title-2">链接要求</h5>
            <div class="tag_a pad-lr-10">
	        <?php if(defined('IN_ADMIN')  && !defined('HTML')) {echo "<div class=\"admin_piao\" yun_action=\"block\" data=\"op=block&tag_md5=f0b69d8366d7f8c1d7a0f92ba649dee7&pos=1\"><a href=\"javascript:void(0);\" class=\"admin_piao_edit\">添加碎片</a>";}$block_tag = Loader::lib('block:block_tag');echo $block_tag->yun_tag(array('pos'=>'1',));?>
			<?php if(defined('IN_ADMIN') && !defined('HTML')) {echo '</div>';}?>
           </div>
        </div>
        
        
    </div>
    
    
    
</div>
<script type="text/javascript">
<!--
	$(function(){
	$.formValidator.initConfig({autotip:true,formid:"myform",onerror:function(msg){}});
	$("#name").formValidator({onshow:"请输入网站名称",onfocus:"请输入网站名称"}).inputValidator({min:1,max:999,onerror:"网站名称不能为空"});
 	$("#url").formValidator({onshow:"请输入网站网址",onfocus:"请输入网站网址"}).inputValidator({min:1,onerror:"请输入网站网址"}).regexValidator({regexp:"^http:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&]*([^<>])*$",onerror:"格式应该为http://www.yuncms.net/"})
 	$("#code").formValidator({onshow:"请输入验证码",onfocus:"验证码不能为空"}).inputValidator({min:1,max:999,onerror:"验证码不能为空"}).ajaxValidator({
	    type : "get",
		url : "api.php?controller=Checkcode&action=check",
		data :"",
		datatype : "html",
		async:'false',
		success : function(data){	
            if(data == 1)
			{
                return true;
			}
            else
			{
                return false;
			}
		},
		buttons: $("#dosubmit"),
		onerror : "验证码错误",
		onwait : "验证中"
	});
 	})
//-->
</script>
<?php include template("content","footer"); ?>
